package com.hohai.mall.product.service;

import com.hohai.mall.product.bo.ProductSpuBO;
import com.hohai.mall.product.convert.ProductSpuConvert;
import com.hohai.mall.product.dao.ProductSpuMapper;
import com.hohai.mall.product.dataobject.ProductSpuDO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author prik
 * @date 2019/7/22
 */
@Service
public class ProductSpuService {

    @Autowired
    ProductSpuMapper productSpuDAO;

    public ProductSpuBO getProductSpu(int id) {
        ProductSpuDO productSpuDO = productSpuDAO.selectById(id);
        // todo 转换不成功
        ProductSpuBO convert = ProductSpuConvert.INSTANCE.convert(productSpuDO);
        return convert;
    }
}
